

	<?php $ar = $this->get("post");?>

<form method="post" action="<?php _e(actionUrl($this))?>" onsubmit="return ajax_form(this)" id="task-form" enctype="multipart/form-data">
<input type="hidden" name="ID" value="<?php _e($post['ID'])?>"/>
	<div class="x-list-title">
		<table width="100%" border="0" height="100%">
			<tr>
				<td align="left">
					<h2>
						Chi tiết công văn đi số <?php _e($ar['code'])?> 
					</h2>
				</td>
				<td align="right">	
					
                    <div class="x-list-options">
						<div class="x-options-container">
							<?php if($this->get('user_id')==$ar['created_by_id']){?>
							<a class="x-button"> Tác vụ khác <span>&#9660;</span></a>
							<div class="x-options">
								<a class="x-options-item" href="#Diploma/Indexs/edit?ID=<?php _e($ar['ID']);?>">Sửa công văn</a>
								<a class="x-options-item" onclick="module_delete('<?php _e(BASE_URL)?>/Diploma/Indexs/delete?ID=<?php _e($ar['ID']);?>')">Xóa công văn</a>
							</div>
							<?php }?>
						</div>
					</div>
				</td>
			</tr>
			</table>	
	</div>

<div class="x-info">
	<div class="form-message"></div>
	<table width="100%" cellpadding="7" class="x-info">
		<tr>
			<td colspan="4" align="right" class="x-info-top">
				<span class="tl">Thông tin chi tiết</span>
				<?php $topRight = $this->get('cr_update');?>
				<span class="tr">Cập nhập lần cuối lúc <?php _e( show_date('H:i:s d-m-Y',$ar['date_updated']) );?>  bởi <a class="userlink username" href="#User/Info?ID=<?php _e($ar['updated_by_id'])?>"> <?php _e( $ar['updated_by_name'] );?></a></span>
			</td>
		</tr>
		<tr>
			<td class="x-info-label">Loại công văn</td>
			<td class="x-info-content">
				<?php _e($ar['subtype'])?>
			</td>
		
			<td class="x-info-label" >Số hiệu</td>
			<td class="x-info-content"><b style="color:red;"><?php _e($ar['code'])?></b></td>
		</tr>
		<tr>
			<td class="x-info-label" >Ngày phát hành</td>
			<td class="x-info-content"><?php _e(show_date(DATE_FORMAT,$ar['date_enactment']));?></td>
		
			<td class="x-info-label">Ngày đi</td>
			<td class="x-info-content">
				<?php _e(show_date(DATE_FORMAT,$ar['date_send']));?>
			</td>
		</tr>
		<tr>
			<td class="x-info-label">Cơ quan ban hành</td>
			<td class="x-info-content">
				<?php _e($ar["ogran_by"]);?>
			</td>
		
			<td class="x-info-label">Trích yếu</td>
			<td class="x-info-content">
				<?php _e($ar["abstracts"]);?>
			</td>
		</tr>
		
		<tr>
			<td class="x-info-label">Người được theo dõi</td>
			<td class="x-info-content">
					<?php $a=array();
						 foreach( $this->get('userView') as $u ){
								$a[]= get_user_link($u);
						}
						 _e(implode(", ",$a));
						 if(count($a)==0) _e('<i>Không có</i>');
					?>
			</td>
		
			<td class="x-info-label">Mức độ ưu tiên xử lý</td>
			<td class="x-info-content">
				<?php 
					switch ($ar["prior"]){
						case 1:_e("Thấp");break;
						case 2:_e("<span style='color:#EAD018;'>Bình thường</span>");break;
						case 3:_e("<span style='color:red;'>Cao</span>");break;
						default:_e("<span style='color:#EAD018;'>Bình thường</span>");
					}
				?>
			</td>
		</tr>
		<tr>
			<td class="x-info-label">Ghi chú</td>
			<td class="x-info-content">
				<?php _e($ar["desc"]);?>
			</td>
			<td class="x-info-label">File đính kèm</td>
			<td class="x-info-content">
				<?php 
					$file = $this->get('files');
					if(count($file)>0){
					foreach($file as $f){?>
					<?php $a=array();?>
					<?php show_thumb( $f, baseUrl()."/Diploma/Index/File?ID={$f['ID']}");?>
					<?php }
					}else{
						_e("<i>Không có file đính kèm.</i>");
					}
				?>
				
			</td>
		</tr>
		
	</table>
</div>
</form>